{% extends "learning_logs/base.html" %}
{%  load bootstrap3 %}

{% block header %}
	<h1> {{ Topic }}</h1>
{% endblock header %}


{% block content %}
<p>
	<a href="{% url 'learning_logs:new_item'  topic.id %}">
	<button type="button" class="btn btn btn-success">Add new Item</button>
    </a>
</p>
<p>
	<span class="label label-info">Topic:</span>
    <span class="label label-default">{{  topic  }}</span>
</p>


	{% for item in items %}
	<div class="panel panel-default">
		<div class="panel-heading">
			<h3>
			<span class="label label-primary">{{ item.date_added | date:'Y-M-d H:i' }} </span>
			<small>
				<a href="{% url 'learning_logs:edit_item'  item.id %}"><button type="button" class="btn btn-xs btn-default">edit item</button</a>
			</small>
			</h3>
		</div>
		 <div class="panel-heading">
		 <p class="text-info">{{ item.text | linebreaks }}</p>
		 </div>
	</div> 
		{% empty %}
			当前主题没有任何条目
	{% endfor %}

{% endblock content%}